<%@ page contentType="text/html;charset=windows-1252"%>
<script language="JavaScript" type="text/javascript">
        function ValidarLogIn()
        { 
            if(document.formlogin._email.value == "")
            {alert("Por favor ingrese el su email. "); document.formlogin._email.focus(); return(false);}
            if(document.formlogin._contrasenia.value == "")
            {alert("Por favor ingrese el su contrasena. "); document.formlogin._contrasenia.focus(); return(false);}
            //document.formlogin.submit();
            return(true);
        }
        function Registrarse()
        { 
            document.location.replace('index?accion=registrar');
        }
        function CerrarSesion()
        {
            document.location.replace('index?<%=(String) session.getAttribute("atributosUrl")%>_unlogin=1');
        }
</script>
 <form method="post" id="formlogin" name="formlogin" action="index?<%=(String) session.getAttribute("loginUrl")%>_login=1" onsubmit="return ValidarLogIn();">
      <table cellpadding="0" cellspacing="0" class="fondoMenu">
        <tr>
            <td colspan="2"  class="hfondoCat">
                <div class="HTextoBlanc13PxCenter">LOGIN</div>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
        <%
        if (session.getAttribute("cliCodigo") == null){
        %>
        <form method="POST" id="formlogin" name="formlogin" action="index?<%=(String) session.getAttribute("loginUrl")%>_login=1" onsubmit="return ValidarLogIn();">
            <tr>
                <td class="textoLogin">E-mail:</td>
                <td>
                    <input id="_email" name="_email" type="text" class="formularioLogin"/>
                </td>
            </tr>
            <tr>
                <td class="textoLogin">Pass:</td>
                <td>
                    <input id="_contrasenia" name="_contrasenia" type="password" class="formularioLogin"/>
                </td>
            </tr>
            <tr class="botonLogin">
                <td colspan="2">
                    <input name="Submit" type="submit" class="boton" value="Entrar"/>
                </td>
            </tr>
        </form>
        <%
        if (request.getAttribute("msgsesion") != null){
        %>
        <tr class="botonLogin">
            <td colspan="2" class="accionArticulo"><%=(String) request.getAttribute("msgsesion")%></td>
        </tr>
        <%
        }
        %>
        <tr class="botonLogin">
          <td colspan="2">
            <input name="Submit2" type="button" class="boton" value="Registrarse" onclick="Registrarse()"/>
          </td>
        </tr>
        <tr class="botonLogin">
            <td colspan="2" class="accionArticulo">
                <a href="index?accion=recordarContrasenia"> 
                    &iquest;Olvid&oacute; su contrase&ntilde;a?
                </a>
                </td>
        </tr>
        <%
        }else{
        %>
        <tr class="botonLogin">
            <td colspan="2" class="accionArticulo">Bienvenido </br> <%=(String) session.getAttribute("cliNombre")%></td>
        </tr>
        <tr class="botonLogin">
          <td colspan="2">
            <input name="Submit2" type="button" class="boton"
                   value="Cerrar Sesion" onclick="CerrarSesion()"/>
          </td>
        </tr>
        <%
        }
        %>
        
      </table>
</form>
